<?php

include_once ("../dao/categoryDAO.php");

function countNumOfCategoryByName($keyword) {
    return countByName($keyword);
}

function getCategoriesBy($keyword, $start_position, $row_per_page) {
    return findBy($keyword, $start_position, $row_per_page);
}

function removeCategory($id) {
    return delete($id);
}

function updateCategory($catID, $name, $order){
    update($catID, $name, $order);
}

function getCategoryById($cateID){
    return loadCategoryByID($cateID);
}

function addCategory($name, $order){
    insert($name, $order);
}

function getAllCategory() {
    return selectAll();
}

function countCatByOrder($order){
    return countByOrder($order);
}

function getCategoryByOrder($order, $keyword){
	return findCategoryByOrder($order, $keyword);
}

function getCategorySortByOrder(){
	return findCategorySortByOrder();
}

function getCategoryByDish($keyword){
	return findCategoryByDish($keyword);
}
?>
